Scope
Ecng.Common
Provides a scope for managing a resource with automatic disposal.
Herda de: Disposable
Construtores
Scope
public Scope()
scope = Scope()
Initializes a new instance of the Scope class with a new instance of T.
Scope
public Scope(T value)
scope = Scope(value)
Initializes a new instance of the Scope class with the specified value.
- value
- The instance of T to be managed.
Scope
public Scope(T value, bool ownInstance)
scope = Scope(value, ownInstance)
Initializes a new instance of the Scope class with the specified value and ownership.
- value
- The instance of T to be managed.
- ownInstance
- Indicates whether the scope owns the instance and is responsible for disposing it.
Propriedades
All
public static ICollection<Scope<T>> All { get; }
value = Scope.All
Gets all scopes in the current hierarchy as a collection.
IsDefined
public static bool IsDefined { get; }
value = Scope.IsDefined
Gets a value indicating whether a current scope is defined.
OwnInstance
public bool OwnInstance { get; }
value = scope.OwnInstance
Gets a value indicating whether the scope owns the managed instance.
Parent
public Scope<T> Parent { get; }
value = scope.Parent
Gets the parent scope of the current scope.
Métodos
DisposeManaged
protected override void DisposeManaged()
scope.DisposeManaged()
Disposes the managed resources used by the Scope class.